package controller;

import dao.ShiyanDao;
import entity.Shiyan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.ShiyanService;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/Qshissjsi")
public class Shiyancon {



    @Resource(name = "shiyanDao")
    private ShiyanDao shiyanDao;

    @Resource(name = "shiyanService")
    private ShiyanService shiyanService;


    @RequestMapping("/Qshi")
    @ResponseBody
    public List<Shiyan> Qshi(){
        List<Shiyan> datails1=shiyanDao.Qshiyans();
        List<Shiyan> datails2=shiyanDao.Shiyan();
        for(int i = 0;i<datails1.size();i++){
            datails1.get(i).setName(datails2.get(i).getName());
            datails1.get(i).setNum(datails2.get(i).getNum());
            datails1.get(i).setMoney(datails2.get(i).getMoney());
        }
        return datails1;
    }
}
